﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PureMVC.Interfaces;
using PureMVC.Patterns;
using SMS.Core.Model;
using System.Windows.Forms;
using SMS.Core.View.Component;

namespace SMS.Core.Controller.Commands
{
    class LoginCommand : SimpleCommand, ICommand
    {
        public override void Execute(INotification notification)
        {
            switch (notification.Name)
            {
                case ModelConstants.UserAccount.LOGIN:
                    var loginProxy = (LoginProxy)Facade.RetrieveProxy(LoginProxy.NAME);
                    loginProxy.Login(
                        ((List<string>)notification.Body)[0],   // username
                        ((List<string>)notification.Body)[1]);  // password
                    break;
            }
        }
    }
}
